package com.yfree.mq

import org.springframework.cloud.stream.annotation.EnableBinding
import org.springframework.cloud.stream.messaging.Source
import org.springframework.messaging.support.MessageBuilder

@EnableBinding(Source::class)
class YMQService(private val source: Source) {
    fun send(data: Map<String, Any?>): Boolean {
        return source.output().send(MessageBuilder.withPayload(data).build())
    }
}
